Bug 547680 – fontconfig monitoring can crash apps
authorBehdad Esfahbod <behdad@gnome.org>
Fri, 15 Aug 2008 19:43:20 +0000 (19:43 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Fri, 15 Aug 2008 19:43:20 +0000 (19:43 +0000)
2008-08-15  Behdad Esfahbod  <behdad@gnome.org>

        Bug 547680 – fontconfig monitoring can crash apps

        * gtk/gtksettings.c (settings_update_fontconfig): Clear pango cache
        before recreating fontconfig config.

svn path=/trunk/; revision=21134

ChangeLog
gtk/gtksettings.c

index dc69953796585dee98bbcbc08fcddaaf14abba62..c9842a07fb0b22de91f8f8a153dc28356f8f5866 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-15  Behdad Esfahbod  <behdad@gnome.org>
+
+       Bug 547680 – fontconfig monitoring can crash apps
+
+       * gtk/gtksettings.c (settings_update_fontconfig): Clear pango cache
+       before recreating fontconfig config.
+
 2008-08-15  Sven Herzberg  <sven@imendio.com>
 
        Use the g_test_*() API for this test
index 3fd7f8cf4f6b333db98c8088a0843f5382bc2b0d..32e783944dc6c5dd9500c3286171373b81f39e28 100644 (file)
@@ -2090,7 +2090,7 @@ settings_update_fontconfig (GtkSettings *settings)
   static guint    last_update_timestamp;
   static gboolean last_update_needed;
 
-  gint timestamp;
+  guint timestamp;
 
   g_object_get (settings,
                "gtk-fontconfig-timestamp", &timestamp,
@@ -2105,11 +2105,12 @@ settings_update_fontconfig (GtkSettings *settings)
       PangoFontMap *fontmap = pango_cairo_font_map_get_default ();
       gboolean update_needed = FALSE;
 
-      if (PANGO_IS_FC_FONT_MAP (fontmap) &&
-         !FcConfigUptoDate (NULL) && FcInitReinitialize ())
+      /* bug 547680 */
+      if (PANGO_IS_FC_FONT_MAP (fontmap) && !FcConfigUptoDate (NULL))
        {
-         update_needed = TRUE;
          pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (fontmap));
+         if (FcInitReinitialize ())
+           update_needed = TRUE;
        }
 
       last_update_timestamp = timestamp;